package com.mvp.shq.washer.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;

import com.mvp.shq.washer.R;
import com.mvp.shq.washer.entity.shop.ShopBanner;
import com.mvp.shq.washer.utils.ImageUtil;
import com.zhouwei.mzbanner.holder.MZViewHolder;

/**
 * Created by shq1 on 2017/9/29.
 */

public class ShopProductBannerViewHolder implements MZViewHolder<String> {
    private ImageView imageView;
    private ImageUtil imageUtil;
    @Override
    public View createView(Context context) {
        imageUtil = new ImageUtil(context);
        View view = LayoutInflater.from(context).inflate(R.layout.item_shop_banner,null);
        imageView = (ImageView)view.findViewById(R.id.img);
        return view;
    }

    @Override
    public void onBind(Context context, int i, String s) {
        imageUtil.loadUrlImage(s,imageView,R.mipmap.banner_loading,R.mipmap.banner_loading_failed);
    }

}
